/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Interpreter.Function;
import Interpreter.InterpreterVisitor;
import ast.AST;
import java.util.ArrayList;
/**
 *
 * @author David
 */
public class IsObjectFunction extends Function{

    @Override
    public Object execute(ArrayList args) {
        
        Object o = ((AST)args.get(0)).accept(new InterpreterVisitor());
        try {
            return (o.getClass() == Class.forName("Interpreter.DSSObject"));
        } catch (ClassNotFoundException ex) {
            System.out.println(ex.toString());
        }
        return false;
    }
}
